home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 1065 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.2 KB

  1. Path: gramercy.ios.com!lalit
  2. From: lalit@gramercy.ios.com (lalit gidwani)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Template Class Linkage?
  5. Date: 9 Jan 1996 02:17:43 GMT
  6. Organization: Internet Online Services
  7. Message-ID: <4csj87$cfl@news2.ios.com>
  8. References: <4cmnjs$mk7@mimsy.cs.umd.edu>
  9. NNTP-Posting-Host: gramercy.ios.com
  10. X-Newsreader: TIN [version 1.2 PL2]
  11.  
  12. Gil Carmel (gilman@cfar.umd.edu) wrote:
  13. : Hi,
  14.  
  15. : I'm just learning templates, and I'm having problems with linkage.
  16. : When the template class member function bodies are included in the ".h" file,
  17. : everything is fine.  But when the function bodies are in a separate ".c" file,
  18. : calls to these functions from other files give an "undefined reference to
  19. : function" error from the linker.  Do template class member functions have 
  20. : to be in the ".h" file, or is this a problem with my compiler?
  21.  
  22. : Thanks for any help,
  23. : Gil
  24.  
  25. : --
  26. : |-----------------------------------------------------------|
  27. : | Gil Carmel             | gilman@wam.umd.edu        |
  28. : | Computer Science Undergraduate | gilman@cfar.umd.edu        |
  29. : | University of Maryland     |                |
  30. : | College Park, MD         |                |
  31. : |-----------------------------------------------------------|
  32. : | |                \o              | |
  33. : | |                 |\              | |
  34. : | |                / \              | |
  35.